/**
Date: 2025-08-13
Copyright (c) 2025 Industrial Software Feature Database
*/
import request from '@/utils/request';

// 模型管理--zip文件解析
export function preImport(data) {
  return request({
    url: '/isfd/modelManagementPart/pre/import',
    method: 'post',
    data
  });
}
//模型库结构定义--获取机型下拉列表
export function getStructureTreeList(param) {
  return request({
    url: `/isfd/modelManagementStructureDefinitionTree/list`,
    method: 'get',
    params: param
  });
}
//模型库结构定义-- 获取结构定义树
export function getStructureTree() {
  return request({
    url: `/isfd/modelManagementStructureDefinitionTree/listTree`,
    method: 'get'
  });
}
//模型库结构定义-- 新增树节点
export function addStructureMenu(data) {
  return request({
    url: `/isfd/modelManagementStructureDefinitionTree`,
    method: 'post',
    data
  });
}
//模型库结构定义-- 修改树节点
export function updateStructureMenu(data) {
  return request({
    url: `/isfd/modelManagementStructureDefinitionTree`,
    method: 'put',
    data
  });
}
//模型库结构定义-- 删除树节点
export function deleteStructureMenu(data) {
  return request({
    url: '/isfd/modelManagementStructureDefinitionTree',
    method: 'delete',
    params: data
  });
}

//模型管理-- 查询左侧树结构
export function getModelListTree() {
  return request({
    url: '/isfd/modelManagementPart/listTree',
    method: 'get'
  });
}
//模型管理--列表数据查询
export function getModelList(data) {
  return request({
    url: '/isfd/modelManagementPart/list',
    method: 'post',
    data
  });
}
//模型管理--查询模型详情
export function getModelDetailById(param) {
  return request({
    url: '/isfd/modelManagementPart/detail',
    method: 'get',
    params: param
  });
}
//模型管理--确认导入zip文件
export function zipImport(data) {
  return request({
    url: '/isfd/modelManagementPart/confirm/import',
    method: 'post',
    data
  });
}
// 模型管理--修改零件
export function updatePart(param) {
  return request({
    url: '/isfd/modelManagementPart/update',
    method: 'post',
    data: param
  });
}
// 模型组建--模型组建任务分页列表
export function getTaskList(param) {
  return request({
    url: '/isfd/modelManagementTask/list',
    method: 'post',
    data: param
  });
}
//模型组建 -- 删除组建任务
export function deleteTask(param) {
  return request({
    url: '/isfd/modelManagementTask/delete',
    method: 'post',
    data: param
  });
}
// 模型组建--获取计算文件快照
export function getSnapshotById(param) {
  return request({
    url: '/isfd/modelManagementCalculateFile/queryById',
    method: 'get',
    params: param
  });
}
// 模型组建--获取必备件列表
export function getNecessaryList(param) {
  return request({
    url: '/isfd/modelManagementNecessaryItems/list',
    method: 'post',
    data: param
  });
}
// 模型组建--获取边界条件列表
export function getBoundaryList(param) {
  return request({
    url: '/isfd/modelManagementBoundary/list',
    method: 'post',
    data: param
  });
}
// 模型组建--获取载荷列表
export function getLoadList(param) {
  return request({
    url: '/isfd/modelManagementLoad/list',
    method: 'post',
    data: param
  });
}

// 模型组建--查询结构定义平铺树
export function getStructureDefinitionTree(param) {
  return request({
    url: '/isfd/modelManagementStructureDefinitionTree/list',
    method: 'get',
    params: param
  });
}
// 模型组建--获取计算文件
export function getComputedList(param) {
  return request({
    url: '/isfd/modelManagementCalculateFile/queryById',
    method: 'get',
    params: param
  });
}
// 模型组建--根据ids查询零件列表
export function getElementsByIds(param) {
  return request({
    url: '/isfd/modelManagementPart/selectPart',
    method: 'post',
    data: param
  });
}
// 模型组建 -- 根据部段查询组建列表
export function getComponentBySection(param) {
  return request({
    url: '/isfd/modelManagementPart/getComponentBySection',
    method: 'get',
    params: param
  });
}
// 模型组建 -- 保存零件
export function saveParts(param) {
  return request({
    url: '/isfd/modelManagementTask/save',
    method: 'post',
    data: param
  });
}
// 模型组建 -- 保存计算文件
export function saveCompputed(param) {
  return request({
    url: '/isfd/modelManagementCalculateFile/save',
    method: 'post',
    data: param
  });
}
// 模型组建 -- 更新计算文件
export function updateComputed(param) {
  return request({
    url: '/isfd/modelManagementCalculateFile',
    method: 'put',
    data: param
  });
}

// 模型组建 -- 根据任务ID查询任务详情
export function getTaskInfoById(param) {
  return request({
    url: '/isfd/modelManagementTask/queryById',
    method: 'get',
    params: param
  });
}
// 模型组建 -- bdf预览
export function queryBdfFileInfo(param) {
  return request({
    url: '/resource/oss/server/download',
    method: 'post',
    data: param
  });
}
// 模型组建 -- 下载计算文件BDF
export function calculateDownlaod(param) {
  return request({
    url: '/isfd/modelManagementCalculateFile/bdf/partAndCalculateBdfDownload',
    method: 'get',
    params: param,
    responseType: 'blob'
  });
}
// 模型组建 -- 下载组建任务BDF
export function taskBDFDownlaod(param) {
  return request({
    url: '/isfd/modelManagementTask/bdf/download',
    method: 'get',
    params: param,
    responseType: 'blob'
  });
}
// 模型组建 -- 导出bom清单
export function exportBom(param) {
  return request({
    url: '/isfd/modelManagementTask/bom/export',
    method: 'get',
    params: param,
    responseType: 'blob'
  });
}
// 模型组建 -- 取消导入
export function cancelImport(param) {
  return request({
    url: '/isfd/modelManagementPart/cancel/import',
    method: 'post',
    data: param,
  });
}
// 模型管理 -- 导出模型零组件清单
export function exportPartsBom(param) {
  return request({
    url: '/isfd/modelManagementPart/bom/export',
    method: 'get',
    params: param,
    responseType: 'blob'
  });
}
// 模型组件 -- 加载模型零件渲染
export function loadPartRender(param) {
  return request({
    url: '/isfd/modelManagementRendering/load',
    method: 'post',
    data: param,
  });
}
// 模型组件 -- 加载模型任务渲染文件
export function getTaskRender(param) {
  return request({
    url: '/isfd/modelManagementRendering/loadTask',
    method: 'post',
    data: param,
  });
}
// 查询零件itemnos
export function getPartItemNos(param) {
  return request({
    url: '/isfd/modelManagementRendering/load',
    method: 'post',
    data: param,
  });
}
// 单个零件导入
export function importPart(param) {
    return request({
        url: '/isfd/modelManagementPart/single/import',
        method: 'post',
        data: param,
    });
}

// 模型管理 - BDF文件详情
export function getModelManagementCardStruct(param) {
  return request({
      url: '/isfd/modelManagementCard/struct',
      method: 'post',
      data: param,
  });
}

// 模型管理 - BDF文件筛选
export function searchModelManagementCard(param) {
  return request({
      url: '/isfd/modelManagementCard/search',
      method: 'post',
      data: param,
  });    
}

// 模型管理 - pshell编辑保存
export function modifyModelManagementPshell(param) {
  return request({
      url: '/isfd/modelManagementCard/save',
      method: 'post',         
      data: param,
  });
}

// 机型批次号查询
export function getModelBatchNoList(params) {                
  return request({      
      url: '/isfd/modelManagementStructureDefinitionTree/batchNoList',
      method: 'get',         
      params,    
  });    
} 

// 根据部段查询组件列表
export function getComponentListBySection(params) {                
  return request({                                                                
      url: '/isfd/modelManagementNecessaryItems/getComponentList',                   
      method: 'get',                                                           
      params,                                                                                                   
  });    
}     
                                                                    
//模型管理-- 查询左侧树结构 -- new
export function getDefaultModelListTree(params) {
  return request({
    url: '/isfd/modelManagementTask/listTree',
    method: 'get',
    params
  });
}

// 单个零件导入 -- 规则检查
export function checkImportSinglePart(data) {
  return request({
    url: '/isfd/modelManagementPart/check/single/import',
    method: 'post',
    data
  });
}

// 组件导入 -- 规则检查
export function checkImportComponent(data) {
  return request({
    url: '/isfd/modelManagementPart/component/check/import',
    method: 'post',
    data
  });
}

// 组件导入- 确认导入
export function importComponent(data) {
  return request({
    url: '/isfd/modelManagementPart/component/confirm/import',
    method: 'post',
    data
  });
}

// 下载全集模型
export function bomDownload(param) {
  return request({
    url: '/isfd/modelManagementTask/bom/download',
    method: 'get',
    params: param,
    responseType: 'blob'
  });
}

// bom导入
export function bomImport(data) {
  return request({
    url: '/isfd/modelManagementTask/bom/import',
    method: 'post',
    data
  });
}

// 构型定义树  删除检查
export function checkDeleteStructureMenu(params) {
  return request({
    url: '/isfd/modelManagementStructureDefinitionTree/remove/check',    
    method: 'get',
    params
  });
}